#ifndef _TEXT_H_
#define _TEXT_H_

#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include "Widget.h"
#include "misc.h"

namespace animationagent {

class Text : public Widget
{
public:
    Text(TTF_Font *f);
    Text(TTF_Font *f, const char *s);
    virtual ~Text();
    virtual void draw(SDL_Surface *screen);
    //virtual void set_alpha(Uint8 a);
    //virtual void set_colorkey(Uint8 r, Uint8 g, Uint8 b);
    virtual void update();
    void set_text(const char *s);
    void append_text(const char *s);
    const char *get_text();
    void set_font(TTF_Font *f);
    void set_bgcolor(SDL_Color &c);
    void set_fncolor(SDL_Color &c);

private:
    TTF_Font *font;
    misc::StringBuffer str;
    SDL_Surface *surface;

    void rerender_text();
};



}

#endif
